package com.yunhe.estatemanage.controller;
import com.yunhe.estatemanage.domain.PaymentReminderConfiguration;
import com.yunhe.estatemanage.model.PaymentReminderConfigurationVo;
import com.yunhe.estatemanage.service.PaymentReminderConfigurationService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;

import org.springframework.web.bind.annotation.*;
import org.springframework.beans.factory.annotation.Autowired;
import com.yunhe.common.model.ResultObject;

import java.util.List;

/**
 * @description 缴费提醒配置
 * @author misty
 * @date 2021-09-06
 */
@Api(value = "PaymentReminderConfiguration", description = "缴费提醒配置维护", tags = {"Model_PaymentReminderConfiguration"})
@RestController
@RequestMapping(value = "/paymentReminderConfiguration")
public class PaymentReminderConfigurationController {

    @Autowired
    private PaymentReminderConfigurationService paymentReminderConfigurationService;

//    /**
//     * 新增
//     * @author misty
//     * @date 2021/09/06
//     **/
//    @ApiOperation("新增缴费提醒配置")
//    @PostMapping("/createPaymentReminderConfiguration")
//    public ResponseEntity<ResultObject> createPaymentReminderConfiguration(@RequestBody List<PaymentReminderConfigurationVo> paymentReminderConfigurationVos){
//        paymentReminderConfigurationService.createPaymentReminderConfiguration(paymentReminderConfigurationVos);
//        return new ResponseEntity<>(new ResultObject<>(), HttpStatus.OK);
//    }
//
//    /**
//     * 刪除
//     * @author misty
//     * @date 2021/09/06
//     **/
//    @ApiOperation("根据id删除缴费提醒配置")
//    @DeleteMapping("/deletePaymentReminderConfiguration")
//    public ResponseEntity<ResultObject> deletePaymentReminderConfiguration(@RequestParam(value = "id",required = true) int id){
//        paymentReminderConfigurationService.deletePaymentReminderConfiguration(id);
//        return new ResponseEntity<>(new ResultObject<>(), HttpStatus.OK);
//    }

    /**
     * 更新
     * @author misty
     * @date 2021/09/06
     **/
    @ApiOperation("更新缴费提醒配置")
    @PostMapping("/updatePaymentReminderConfiguration")
    public ResponseEntity<ResultObject> updatePaymentReminderConfiguration(@RequestBody List<PaymentReminderConfigurationVo> paymentReminderConfigurationVos){
        paymentReminderConfigurationService.updatePaymentReminderConfiguration(paymentReminderConfigurationVos);
        return new ResponseEntity<>(new ResultObject<>(), HttpStatus.OK);
    }

//    /**
//     * 查询 根据主键 id 查询
//     * @author misty
//     * @date 2021/09/06
//     **/
//    @ApiOperation("根据id查询缴费提醒配置")
//    @GetMapping("/findPaymentReminderConfigurationById")
//    public ResponseEntity<ResultObject<PaymentReminderConfiguration>> findPaymentReminderConfigurationById(@RequestParam(value = "id",required = true) int id){
//        return new ResponseEntity<>(new ResultObject(paymentReminderConfigurationService.findPaymentReminderConfigurationById(id)),HttpStatus.OK);
//    }

    /**
     * 查询 根据主键 id 查询
     * @author misty
     * @date 2021/09/06
     **/
    @ApiOperation("根据真实园区id查询缴费提醒配置信息")
    @GetMapping("/findPaymentReminderConfigurationByStationId")
    public ResponseEntity<ResultObject<List<PaymentReminderConfigurationVo>>> findPaymentReminderConfigurationByStationId(@RequestParam(value = "realStationId",required = true) Long realStationId){
        return new ResponseEntity<>(new ResultObject(paymentReminderConfigurationService.findPaymentReminderConfigurationByStationId(realStationId)),HttpStatus.OK);
    }

}